{% extends "base.html" %}

{% load i18n rules pagination %}

{% block content %}
<div class="md:flex justify-between items-center">
    <div class="flex-1 truncate display-none md:display-block mr-4 md:mb-0 mb-4" title="{{request.site.name|default:"Dashboard"}}">
        <h4 class="heading truncate">{{request.site.name|default:"Dashboard"}}</h4>
    </div>
    <div class="flex items-center">
        <div class="mr-1">
            {% include 'dashboard/includes/date_range.html' %}
        </div>
        {% has_perm "core.create_service" user as can_create %}
        {% if can_create %}
        <a href="{% url 'dashboard:service_create' %}" class="button field !low bg-neutral-000 w-auto">+ {% trans 'New Service' %}</a>
        {% endif %}
    </div>
</div>
<hr class="sep h-8 md:h-12">
{% for object in object_list|dictsortreversed:"stats.session_count" %}
{% include 'dashboard/includes/service_overview.html' %}
{% empty %}
<p class="aside ~urge !high">You don't have any services yet. {% if can_create %}Get started by <a href="{% url 'dashboard:service_create' %}" class="underline">creating one</a>.{% endif %}</p>
{% endfor %}

{% if object_list %}
{% pagination page_obj request %}
{% endif %}

{% endblock %}